// JavaScript Document

function loadNotices() {
	var uri = "notices!getNotices.action";
	var myAjax = new Ajax.Updater(
			{success: 'notice'}, 
			uri, 
			{
				method: 'get'
				// parameters: pars
				// onFailure: reportError
			});
}

window.onload= function show(){
		var s1=document.getElementById("s1");
		var s2=document.getElementById("s2");
		var s3=document.getElementById("s3");
		var s4=document.getElementById("s4");
		var s5=document.getElementById("s5");
		var s6=document.getElementById("s6");
		var s7=document.getElementById("s7");
		var s8=document.getElementById("s8");
		var lk1=document.getElementById("lk1");
		var lk2=document.getElementById("lk2");
		var lk3=document.getElementById("lk3");
		var lk4=document.getElementById("lk4");
		var hom=document.getElementById("home");
		s1.style.display="none";
		s2.style.display="none";
		s3.style.display="none";
		s4.style.display="none";
		
		s5.style.display="none";
		s6.style.display="none";
		s7.style.display="none";
		s8.style.display="none";
		
		lk1.style.display="none";
		lk2.style.display="none";
		lk3.style.display="none";
		lk4.style.display="none";
		
		hom.style.backgroundImage="url(frontPage/img/menu.png)";
		hom.style.fontSize="28px";

	};


function showSource(){
	
	var s1=document.getElementById("s1");
	var s2=document.getElementById("s2");
	var s3=document.getElementById("s3");
	var s4=document.getElementById("s4");
	
	
	if (s1.style.display=="none"){
		s1.style.display="list-item";
	} else if(s1.style.display=="list-item"){
		s1.style.display="none";
	}
	if (s2.style.display=="none"){
		s2.style.display="list-item";
	} else if(s2.style.display=="list-item"){
		s2.style.display="none";
	}
	if (s3.style.display=="none"){
		s3.style.display="list-item";
	} else if(s3.style.display=="list-item"){
		s3.style.display="none";
	}
	if (s4.style.display=="none"){
		s4.style.display="list-item";
	} else if(s4.style.display=="list-item"){
		s4.style.display="none";
	}
 }
 function showLink(){
	
	var lk1=document.getElementById("lk1");
	var lk2=document.getElementById("lk2");
	var lk3=document.getElementById("lk3");
	var lk4=document.getElementById("lk4");
	
	
	if (lk1.style.display=="none"){
		lk1.style.display="list-item";
	} else if(lk1.style.display=="list-item"){
		lk1.style.display="none";
	}
	if (lk2.style.display=="none"){
		lk2.style.display="list-item";
	} else if(lk2.style.display=="list-item"){
		lk2.style.display="none";
	}
	if (lk3.style.display=="none"){
		lk3.style.display="list-item";
	} else if(lk3.style.display=="list-item"){
		lk3.style.display="none";
	}
	if (lk4.style.display=="none"){
		lk4.style.display="list-item";
	} else if(lk4.style.display=="list-item"){
		lk4.style.display="none";
	}

 }
 function showSyllabus(){
	 var syllabus_content=document.getElementById("syllabus_content");
	 var course=document.getElementById("course_content");
	 var syllabus=document.getElementById("syllabus");
	 var hom=document.getElementById("home");
	 syllabus_content.style.display="block";
	 course.style.display="none"; 
	 syllabus.style.fontSize="28px";
	 hom.style.fontSize="24px";
	 syllabus.style.background="url(frontPage/img/menu.png) no-repeat";
 }

 function Resource(){
	 var resources=document.getElementById("resource");
		
		if(window.ActiveXObject){
			var resource=resources.firstChild;
		  	var sources=resource.nextSibling.nextSibling.childNodes;
		}else{
			var resource=resources.firstChild.nextSibling;
			var sources=resource.nextSibling.nextSibling.childNodes;
		}
		
		resource.style.fontSize="28px";
		resource.style.backgroundImage="url(frontPage/img/menu.png)";
		for(var i=0;i<sources.length;i++){
			if(sources.item(i).nodeName=="LI"){
				sources.item(i).style.display="list-item";
			}
		}
		resources.onmouseout=function(){
			for(var i=0;i<sources.length;i++){
				if(sources.item(i).nodeName=="LI"){
					sources.item(i).style.display="none";
				}
			}
			resource.style.fontSize="24px";
			resource.style.backgroundImage="none";
		}
	
 }
 function showSyllabus(){
	 var syllabus_content=document.getElementById("syllabus_content");
	 var course=document.getElementById("course_content");
	 var syllabus=document.getElementById("syllabus");
	 var hom=document.getElementById("home");
	 syllabus_content.style.display="block";
	 course.style.display="none"; 
	 syllabus.style.fontSize="28px";
	 syllabus.style.background="url(frontPage/img/menu.png) no-repeat";
	 hom.style.backgroundImage="none";
 }
 function reHome(){
	 var syllabus_content=document.getElementById("syllabus_content");
	 var hom=document.getElementById("home");
	 var syllabus=document.getElementById("syllabus");
	 var course_content=document.getElementById("course_content");
	 syllabus.style.fontSize="24px";
	 course_content.style.display="block";
	 syllabus_content.style.display="none";
 }
 function homeover(){
	 var hom=document.getElementById("home");
	 hom.style.fontSize="28px";
	 hom.style.backgroundImage="url(frontPage/img/home.png)";
 }
 function homeout(){
	 var hom=document.getElementById("home");
	 hom.style.fontSize="24px";
	 var course_content=document.getElementById("course_content");
	 var syllabus=document.getElementById("syllabus");
	 if(course_content.style.display=="block"){
		 hom.style.backgroundImage="url(frontPage/img/menu.png)";
		 syllabus.style.backgroundImage="none";
		 syllabus.style.fontSize="24px";
		 hom.style.fontSize="28px";
	 }else{
		 hom.style.backgroundImage="none";
	 }
 }
 function over(id){
	 var menu=document.getElementById(id);
	 menu.style.fontSize="28px";
	 menu.style.backgroundImage="url(frontPage/img/menu.png)";
 }
 function out(id){
	 var menu=document.getElementById(id);
	 menu.style.fontSize="24px";
	 menu.style.backgroundImage="none";
 }
 function Syllabusout(id){
	 var menu=document.getElementById(id);
	 var hom=document.getElementById("home");
	 menu.style.fontSize="24px";
	 var syllabus_content=document.getElementById("syllabus_content");
	 if(syllabus_content.style.display=="block"){
		 menu.style.backgroundImage="url(frontPage/img/menu.png)";
		 menu.style.fontSize="28px";
		 hom.style.fontSize="24px";
	 }else{
		 menu.style.backgroundImage="none";
	 }
 }